package com.itheima.dao;

import com.itheima.entity.BirdList;
import com.itheima.entity.Crow;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Birdtest {
    @Test
    public void birdfly(){
        System.out.println("天空飞来一群鸟，有两只乌鸦，两只凤凰。");
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
        BirdList birdList = (BirdList) applicationContext.getBean("birdList");
        birdList.getCrowList().get(0).birdfly();
        birdList.getCrowList().get(1).birdfly();
        birdList.getPhoenixList().get(0).birdfly();
        birdList.getPhoenixList().get(1).birdfly();
    }
}
